package com.itheima.myfile;

import java.io.File;
import java.io.IOException;

public class Demo3 {
    public static void main(String[] args) throws IOException {
        File file = new File("day12_file&字节流\\bbb");
        if (!file.exists()){
            boolean result = file.mkdirs();
        }
        File file1 = new File(file,"abc.txt");
        File file2 = new File(file,"abc.java");
        file1.createNewFile();
        file2.createNewFile();

        //判断abc.java是不是一个文件
        System.out.println(file2.isFile());

        //判断abc.txt是不是一个文件夹
        System.out.println(file1.isDirectory());

        //获取文件名称
        System.out.println(file1.getName());

        System.out.println(file.getName());
    }
}
